import instance from './request'

export default {
    // 封装get方法
    get(url, params, headers) {
        console.log(url, params, headers, '===开始向后端发起获取请求');
        return instance.get(url, { params }, headers)
    },
    // 封装post方法
    post(url, data) {
        console.log(url, data, '===开始向后端发起添加请求');
        return instance.post(url, data)
    },
    // 封装delete方法
    delete(url, params) {
        console.log(url, params, '===开始向后端发起删除请求');
        return instance.delete(url, { params })
    },
    // 封装patch方法
    patch(url, params) {
        console.log(url, params, '===开始向后端发起修改请求');
        return instance.patch(url, params)

    }

}